package com.linkage.util.config;

import java.util.List;
import java.util.Map;

public class ConvertPropertyConfigBean {
	
	private String businessName;
	private String className;
	public ConvertPropertyConfigBean()
	{
		
	}
	public ConvertPropertyConfigBean(String businessName)
	{
		this.businessName = businessName;
	}
	
	public boolean isExist() throws Exception
	{
		if(null==this.getBusinessName() || this.getBusinessName().equals(""))
		{
			return false;
		}
		return ConvertPropertyConfig.isExist(this.getBusinessName());
	}
	
	public String getResultClassName() throws Exception
	{
		if(null==this.getBusinessName() || this.getBusinessName().equals(""))
		{
			return null;
		}
		return ConvertPropertyConfig.getResultClass(this.getBusinessName());
	}
	public List<Map<String, String>> getProperties() throws Exception
	{
		if(null==this.getBusinessName() || this.getBusinessName().equals(""))
		{
			return null;
		}
		return ConvertPropertyConfig.getProperiesList(this.getBusinessName());
	}
	
	public List<Map<String, String>> getPropertyParamsByIndex(int index) throws Exception
	{
		if(null==this.getBusinessName() || this.getBusinessName().equals(""))
		{
			return null;
		}
		return ConvertPropertyConfig.getPropertyParamsByIndex(this.getBusinessName(), index);
	}
	
	public boolean isNewInstance() throws Exception
	{
		if(null==this.getBusinessName() || this.getBusinessName().equals(""))
		{
			return false;
		}
		return ConvertPropertyConfig.isNewInstance(this.getBusinessName());
	}

	public String getBusinessName() {
		return businessName;
	}
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}

	

}
